﻿using SqlSugar;

namespace sixgod.Model.WorkFlow
{
    [SugarTable("FormItem_{year}{month}{day}")]
    [SplitTable(SplitType.Year)]
    public class FormItem:ModelBase
    {
        [SugarColumn(Length = 64,ColumnDescription = "流程ID")]
        public string? WorkFlowId { get; set; }

        public string Name { get; set; }

        [SugarColumn(Length = 8)]
        public string Type { get; set; }

        [SugarColumn(IsNullable = true)]
        public string Url { get; set; }

        /// <summary>
        /// 自定义接口的键
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string Key { get; set; }

        /// <summary>
        /// 自定义接口的值
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string? Value { get; set; }

        /// <summary>
        /// 自定义接口返回数据路径
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string Format { get; set; }

        /// <summary>
        /// 是否多选
        /// </summary>
        public int? Many { get; set; }


        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnDescription = "创建时间", IsOnlyIgnoreUpdate = true)]
        [SplitField]
        public override DateTime CreateTime { get; set; }

        /// <summary>
        /// 模型数据验证
        /// </summary>
        /// <returns></returns>
        public override (bool, string) Verify()
        {
            return (false, null);
        }
    }
}